import request from '@/utils/request'

/**
 * 获取用户
 * @param {*} params
 * @returns
 */
export function getList(params) {
  return request({
    url: '/demo/user',
    method: 'get',
    params
  })
}

/**
 * 更新用户
 * @param {*} user
 * @returns
 */
export function updateUser(user) {
  return request({
    url: '/demo/user',
    method: 'put',
    data: user
  })
}

/**
 * 删除用户
 * @param {*} user
 * @returns
 */
export function deleteUser(params) {
  return request({
    url: '/demo/user?id=' + params,
    method: 'delete'
  })
}

export function addUser(user) {
  return request({
    url: '/demo/user',
    method: 'post',
    data: user
  })
}
